﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sales.Data.Access.Persistence
{
    public abstract class PersistenceFactory<T> where T : class, new()
    {
        private static T _Instance;

        public static T Instance
        {
            get
            {
                if (_Instance == null)
                {
                    lock (typeof(PersistenceFactory<T>))
                    {
                        _Instance = new T();
                    }
                }

                return _Instance;
            }
        }

    }
}
